package com.yspa.bloodPressure.controller;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.hsnn.medstgmini.util.Pagination;
import com.yspa.bloodPressure.service.BloodPressureManager;
/**
 * 血压
 * @author Administrator
 *
 */
@Controller
@RequestMapping("/bloodPressure")
public class BloodPressureController {

	@Autowired
	private HttpServletRequest request;
	@Autowired
	private BloodPressureManager manager;
	/**
	 * 跳向血压列表页面
	 * @return
	 */
	@RequestMapping("/toBloodPressureList")
	public String toBloodPressureList(){
		return "/yspa/bloodPressure/bloodPressureList";
	}
	/**
	 * 获取血压列表数据
	 * @return
	 */
	@RequestMapping("/getBloodPressureList")
	@ResponseBody
	public Pagination getBloodPressureList(){
		Pagination page = new Pagination(request);
		page.getConditions().put("title", request.getParameter("title"));
		manager.getBloodPressureList(page);
		return page;
	}
	/**
	 * 根据ID获取信息
	 * @return
	 */
	@RequestMapping("/getDataInfo")
	@ResponseBody
	public Pagination getDataInfo(){
		String id = request.getParameter("id");
		Map<String, Object> obj = manager.getDataInfo(id);
		Pagination page = new Pagination();
		page.setRows(obj);
		return page;
	}
	
}
